package org.example.springboot.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.springboot.entity.SuperUser;

@Mapper
public interface SuperUserMapper {

    @Insert("INSERT INTO superuser (account, password) VALUES (#{account}, #{password})")
    void insert(SuperUser superUser);

    @Select("SELECT * FROM superuser WHERE account = #{account}")
    SuperUser selectByAccount(String account);

    @Update("UPDATE superuser SET username = #{username}, phone_number = #{phone_number}, city = #{city}, avatar = #{avatar} WHERE account = #{account}")
    void updateSuperUser(SuperUser user);

}

